<? include 'server_config.php'; 

if($_SESSION['user_idx'] == "")
{
	?>
	<script>
		location.href='login.php';
	</script>
	<?
	return;
}

$comment_idx = $_GET['idx'];
?>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="Stylesheet" type="text/css" href="./css/common.css" />
</head>
<body bgcolor="#ffffff">
<?

$sql = "
SELECT user_idx, content
FROM ndd_comment
WHERE 
comment_idx = '$comment_idx' ;
";

//echo $sql;
$result = mysql_query($sql,$connect);
$row = mysql_fetch_row($result);

if($_SESSION['user_idx'] != $row[0] || $row[1]=="")
{
	?>
		<script> 
		parent.location.reload();
		</script>
	<?
	return;
}

$content = $row[1];


?>


			<form action='board_comment_add.php' method='post' name='frm_comment_modify'>
				<input type='hidden' name='comment_idx' value='<? echo $comment_idx; ?>'>

				<div style="width:600px;">

					
					<div style="float:left;width:500px;">
						<textarea name='content' style='width:100%;height:55px;' "><? echo $content ?></textarea><br>
					</div>
					<div style="float:left;width:100px;text-align:right;">
						취소<br>
						<a onclick='frm_comment_modify.submit();' style='cursor:pointer;'>완료</a>
					</div>
					<div style="clear:both;"></div>

				
				<SCRIPT type="text/javascript">
				setTimeout("textareaSetLine(document.getElementsByName('content')[0]);",100);
//				setTimeout("textareaSetLine(parent.ifr_comment);",100);
//				alert(parent.ifr_comment);
				 function textareaSetLine(textarea)
				 {
					if(textarea.style.pixelHeight>0)
					 {
				 
						  var currentHeight = textarea.style.pixelHeight;
						  var overHeight = textarea.scrollHeight-5;
							//alert( currentHeight+" / "+overHeight);
						  if(overHeight >= currentHeight)
						   textarea.style.pixelHeight = overHeight + 5;
				 
					 }
					 else
					 {


						  if(textarea.scrollHeight > textarea.clientHeight)
						 {
						   textarea.style.height = (textarea.scrollHeight + 5)+'px';
//						 alert(textarea.scrollHeight+"/"+textarea.clientHeight);
						 }
					 }
				 }
				</SCRIPT>

				</div>
			</form>

</body>
</html>